var ExifImage = require('exif').ExifImage;

var fs = require('fs');

try {
    new ExifImage({ image : 'exif-test-01.jpg' }, function (error, image) {
        if (error)
            console.log('Error: '+error.message);
        else{
        	fs.appendFile('exif-test.txt', JSON.stringify(image), function (err) {
				if (err) throw err;
				// console.log('The "data to append" was appended to file!');
			});


			// console.log(image); // Do something with your data!

        }
            
    });
} catch (error) {
    console.log('Error: ' + error);
}